package com.org.platform.support.conponents.limit;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class LimitTest {

  public static void main(String args[]) {
    String reqUrl = "a";
    Integer limitCount = 3;
    Long limitTime = 3000L;
    ExecutorService threadPool = Executors.newFixedThreadPool(500);
    for (int i = 0; i < 50000; i++) {
      threadPool.execute(new Runnable() {
        @Override
        public void run() {
          boolean canAccess = Limit.canAccess(reqUrl, limitTime, limitCount);
          System.out.println("canAccess:" + canAccess);
        }
      });
    }
    threadPool.shutdown();
  }


}
